package cn.zust.ly.play.Exa;

import java.util.Scanner;

/**
 * Created by liy on 2016/12/1.
 */
public class Test06 {
    public static void main(String[] args) {
        Scanner sc = new  Scanner(System.in);
        while(true) {
            int n = sc.nextInt();
            System.out.println(twinPrimeNum(n));
        }
    }

    public static boolean isPrime(int x)
    {
        for(int i=2; i<=x/2; i++)
        {
            if(x%i==0)   return false;
        }
        return true;
    }

    public static int twinPrimeNum(int n)
    {
        int sum = 0;
        for(int i=2; i<n; i++)
        {
            if(isPrime(i) &&  isPrime(i+2)) sum++;
        }

        return sum;
    }


}
